Matthias Clasen [Mon, 20 Sep 2021 04:01:24 +0000 (00:01 -0400)]
window: Drop some dead code
The gtk_window_set_buildable_property implementation
was only used to set the unused builder_visible flag.
Remove both the flag and the vfunc.
This means we no longer have any set_buildable_property
implementations and could eventually drop that vfunc and
the support for it in GtkBuilder.
Matthias Clasen [Mon, 20 Sep 2021 03:54:38 +0000 (23:54 -0400)]
builder: Cosmetics
Matthias Clasen [Mon, 20 Sep 2021 02:30:34 +0000 (22:30 -0400)]
builder: Small optimization
Use g_object_setv where we can.
It would be much nicer if we could pass the
pspecs we already have, and avoid having GObject
look them up again.
Matthias Clasen [Mon, 20 Sep 2021 02:13:00 +0000 (22:13 -0400)]
builder: Avoid a pointless call
pspec->name is guaranteed to be interned already.
Matthias Clasen [Mon, 20 Sep 2021 01:56:43 +0000 (21:56 -0400)]
builder: Drop unused part of private api
The aliases arguments was used to support 'primary',
but we no longer have that, and all callers pass
NULL for aliases. So, just drop it.
Emin Tufan Çetin [Sun, 19 Sep 2021 17:22:22 +0000 (17:22 +0000)]
Update Turkish translation
Emin Tufan Çetin [Sun, 19 Sep 2021 17:18:57 +0000 (17:18 +0000)]
Update Turkish translation
Matthias Clasen [Sun, 19 Sep 2021 12:53:59 +0000 (12:53 +0000)]
Merge branch 'resource-cleanup' into 'master'
Clean up gesture icons
See merge request GNOME/gtk!3978
Matthias Clasen [Sun, 19 Sep 2021 12:26:14 +0000 (08:26 -0400)]
resources: Treat svgs as xml
They can have their whitespace removed just the same.
Matthias Clasen [Sun, 19 Sep 2021 12:13:46 +0000 (08:13 -0400)]
Clean up gesture icons
These had duplicate drawing in them, and were
saved with all the extra Inkscape data.
Matthias Clasen [Sat, 18 Sep 2021 23:02:00 +0000 (23:02 +0000)]
Merge branch 'delayed-loading' into 'master'
gtk-demo: Cosmetics
See merge request GNOME/gtk!3975
Matthias Clasen [Sat, 18 Sep 2021 18:13:22 +0000 (14:13 -0400)]
Use GtkLoader for image loading
This avoids blocking on image loading while
we have better things to do.
Matthias Clasen [Sat, 18 Sep 2021 17:25:47 +0000 (13:25 -0400)]
Add delayed loading for textures
Add a private GdkPaintable implementation that
loads a texture in a thread, and does not show
anything until the texture is loaded. This avoid
blocking on image loading in the main thread.
Matthias Clasen [Sat, 18 Sep 2021 18:12:39 +0000 (14:12 -0400)]
loaders: Add profiler marks
These are potentially expensive calls, we
should make sure they show up in profiles.
Jordi Mas [Sat, 18 Sep 2021 19:15:31 +0000 (21:15 +0200)]
Update Catalan translation
Matthias Clasen [Sat, 18 Sep 2021 16:04:40 +0000 (12:04 -0400)]
builder: Cosmetics
Matthias Clasen [Sat, 18 Sep 2021 15:07:09 +0000 (11:07 -0400)]
gtk-demo: Cosmetics
Tweak the color of the outlines in the font rendering
demo.
Matthias Clasen [Sat, 18 Sep 2021 15:04:09 +0000 (15:04 +0000)]
Merge branch 'wip/baedert/for-master' into 'master'
label: Remove redundant store
Closes #4196
See merge request GNOME/gtk!3891
Timm Bäder [Sat, 18 Sep 2021 14:48:48 +0000 (16:48 +0200)]
widget factory: Scale down jpeg images
Piotr Drąg [Sat, 18 Sep 2021 11:12:42 +0000 (13:12 +0200)]
Update POTFILES.in
Timm Bäder [Sat, 18 Sep 2021 11:08:46 +0000 (13:08 +0200)]
cssimageurl: Explicitly check for local_error != NULL
This should always be the case since gdk_texture_new_from_file should
always set the error when it returns NULL, but make it explicit anyway.
Timm Bäder [Sat, 18 Sep 2021 10:53:41 +0000 (12:53 +0200)]
constraintsolver: Remove a dead assignment
Timm Bäder [Sat, 18 Sep 2021 07:00:16 +0000 (09:00 +0200)]
gdktiff: Use guint32 instead of int32
The latter seems to be deprecated.
Matthias Clasen [Sat, 18 Sep 2021 06:35:08 +0000 (06:35 +0000)]
Merge branch 'transform-work' into 'master'
transform: Add sections
See merge request GNOME/gtk!3974
Timm Bäder [Sat, 11 Sep 2021 11:32:33 +0000 (13:32 +0200)]
window: Fix mnemonics-visible getter+setter annotations
Timm Bäder [Fri, 27 Aug 2021 14:37:37 +0000 (16:37 +0200)]
stackswitcher: Expand child buttons
Fixes #4196
Timm Bäder [Sat, 7 Aug 2021 09:58:46 +0000 (11:58 +0200)]
inspector: Cache if we have ever constructed a window
Silly optimization to get rid of
gtk_main_do_event
gtk_inspector_handle_event
gtk_inspector_window_get_for_display
g_object_get_data
showing up in profiles even though it's useless since we've never even
created any inspector window in the first place.
Matthias Clasen [Sat, 18 Sep 2021 06:06:00 +0000 (02:06 -0400)]
Add gsk_transform_to_2d_components
This function decomposes a general 2D transform
into skew, scale, rotation and translation.
Tests included.
Matthias Clasen [Sat, 18 Sep 2021 03:59:52 +0000 (03:59 +0000)]
Merge branch 'gbsneto/fix-filechooserwidget-choices' into 'master'
File chooser choice fixes
See merge request GNOME/gtk!3973
Georges Basile Stavracas Neto [Sat, 18 Sep 2021 03:17:36 +0000 (00:17 -0300)]
filechooserwidget: Return an id in get_choice()
gtk_file_chooser_widget_get_choice() is supposed to return the option
id of the choice, but it currently is returning the option label.
Return the option id instead.
Georges Basile Stavracas Neto [Sat, 18 Sep 2021 03:14:55 +0000 (00:14 -0300)]
filechooserwidget: Match choice id from "options"
When choices are added to the file chooser widget, the options of
that choice are stored object data under the "options" key. However,
gtk_file_chooser_widget_set_choice() was checking for "choices".
Retrieve the options from the "options" key stored data object data.
Matthias Clasen [Sat, 18 Sep 2021 02:37:08 +0000 (22:37 -0400)]
Add more transform tests
Test gsk_transform_to_2d.
Matthias Clasen [Sat, 18 Sep 2021 02:22:21 +0000 (02:22 +0000)]
Merge branch 'static-analysis-fixes' into 'master'
label: Remove a dead assignment
See merge request GNOME/gtk!3972
Matthias Clasen [Sat, 18 Sep 2021 02:01:55 +0000 (22:01 -0400)]
gsk: Add skew transforms
Add gsk_transform_skew() to make our transform
api more complete wrt to what you would expect
for a graphics api.
Matthias Clasen [Sat, 18 Sep 2021 00:51:47 +0000 (20:51 -0400)]
transform: Add sections
This makes the code easier to navigate (for me).
Matthias Clasen [Sat, 18 Sep 2021 02:05:22 +0000 (22:05 -0400)]
textview: Remove a dead store
Pointed out by clang.
Matthias Clasen [Sat, 18 Sep 2021 02:03:56 +0000 (22:03 -0400)]
listitemmanager: Add a few assertions
This might help poor static analyzers.
Matthias Clasen [Sat, 18 Sep 2021 00:26:14 +0000 (00:26 +0000)]
Merge branch 'more-glyph-drawing-fixes' into 'master'
ngl: Use exact device scales for glyphs
See merge request GNOME/gtk!3971
Matthias Clasen [Sat, 18 Sep 2021 00:02:12 +0000 (20:02 -0400)]
imcontextsimple: Rewrite a function slightly
This hopefully avoids upsetting static analyis.
Matthias Clasen [Fri, 17 Sep 2021 23:53:00 +0000 (19:53 -0400)]
label: Remove a dead assignment
It may have quieted gcc at some point, but
it upsets clang nowadays. Remove it.
Matthias Clasen [Fri, 17 Sep 2021 23:31:41 +0000 (23:31 +0000)]
Merge branch 'glyph-clipping-fixes' into 'master'
gtk-demo: Improve ink extents rendering
See merge request GNOME/gtk!3969
Matthias Clasen [Fri, 17 Sep 2021 23:11:06 +0000 (19:11 -0400)]
Revert "gsk: Stop enlarging text bounding boxes"
This reverts commit
87af45403ace1047b91ddbab98d9d5a5e15b84eb.
I've found that this change is needed to ensure that the
bounding boxes of text nodes encompass all the glyphd drawing.
Without it, we overdraw the widget boundaries and cut off
glyphs.
Matthias Clasen [Fri, 17 Sep 2021 23:07:55 +0000 (19:07 -0400)]
ngl: Use exact device scales for glyphs
We are rendering the glyphs on a larger surface,
and we should avoid introducing unnecessary
rounding errors here. Also, I've found that
we always need to enlarge the surface by one
pixels in each direction to avoid cutting off
the tops of large glyphs.
Matthias Clasen [Fri, 17 Sep 2021 20:07:51 +0000 (16:07 -0400)]
gtk-demo: Improve ink extents rendering
Show the pixel-aligned ink rectangle, so we can
see that it includes all the pixels that are inked.
Matthias Clasen [Fri, 17 Sep 2021 19:24:26 +0000 (15:24 -0400)]
gtk-demo: Fix non-circular buttons
Matthias Clasen [Fri, 17 Sep 2021 18:35:41 +0000 (18:35 +0000)]
Merge branch 'glyph-clipping-fixes' into 'master'
gsk: Stop enlarging text bounding boxes
See merge request GNOME/gtk!3968
Matthias Clasen [Fri, 17 Sep 2021 18:06:30 +0000 (18:06 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
icontheme: Fix variable mixup leading to crashes
Closes #4269
See merge request GNOME/gtk!3967
Benjamin Otte [Fri, 17 Sep 2021 16:51:59 +0000 (18:51 +0200)]
icontheme: Fix variable mixup leading to crashes
Note: Don't have 2 variables named "icon" and "gicon", you will screw
them up.
reftests included.
Fixes #4269
Matthias Clasen [Fri, 17 Sep 2021 17:17:53 +0000 (13:17 -0400)]
Fix glyph cache entry sizing
The subpixel-positioned glyph extends on both sides.
Matthias Clasen [Fri, 17 Sep 2021 16:51:52 +0000 (16:51 +0000)]
Merge branch 'menu_button_a11y_improvements' into 'master'
Set correct accessible relations for GtkMenuButton
Closes #4254
See merge request GNOME/gtk!3950
Matthias Clasen [Fri, 17 Sep 2021 16:37:36 +0000 (12:37 -0400)]
gsk: Stop enlarging text bounding boxes
This should not be necessary and only serves
to make the actual bugs harder to find.
Emmanuele Bassi [Fri, 17 Sep 2021 16:26:00 +0000 (16:26 +0000)]
Apply 4 suggestion(s) to 1 file(s)
Matthias Clasen [Fri, 17 Sep 2021 16:22:04 +0000 (16:22 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
gsk: Add a test for transform_bounds
See merge request GNOME/gtk!3966
Matthias Clasen [Fri, 17 Sep 2021 15:24:54 +0000 (11:24 -0400)]
testsuite: Run the clipboard test in isolation
We can't have other test pop up windows, and possibly
stealing focus and preventing us from getting data
offers. So, run the clipboard test in isolation.
Matthias Clasen [Fri, 17 Sep 2021 13:57:07 +0000 (09:57 -0400)]
transform: Improve docs
Add an example for reconstructing transforms.
Matthias Clasen [Fri, 17 Sep 2021 13:42:20 +0000 (09:42 -0400)]
gsk: Handle 2D transforms better
For 2D transforms, we can read the scale
factors more directly off the matrix.
This should eventually be moved out into a
function to decompose a 2D transform into
scale + rotation + skew + translation.
Matthias Clasen [Fri, 17 Sep 2021 13:29:55 +0000 (09:29 -0400)]
node editor: Preserve aspect ratio
We don't want to distort our rendering.
Tell the paintable to keep the aspect
ratio.
Matthias Clasen [Fri, 17 Sep 2021 13:28:12 +0000 (09:28 -0400)]
rendernodepaintable: Provide accurate aspect ratio
Since we report width and height as integers, the
default implementation of this introduces rounding
errors. This shows up in the node-editor, as having
uneven scale factors like sx=1.0 and sy=1.0035.
Text nodes don't handle uneven scales like that well
and overdraw.
Lukáš Tyrychtr [Fri, 17 Sep 2021 13:11:26 +0000 (15:11 +0200)]
Delete unneccessary comment and make other more descriptive
Matthias Clasen [Fri, 17 Sep 2021 11:43:07 +0000 (07:43 -0400)]
gsk: Add a test for transform_bounds
Matthias Clasen [Fri, 17 Sep 2021 10:52:59 +0000 (10:52 +0000)]
Merge branch 'fix-typo' into 'master'
gtkcolorbutton: Fix documentation
See merge request GNOME/gtk!3965
James Westman [Fri, 17 Sep 2021 04:53:42 +0000 (23:53 -0500)]
gtkcolorbutton: Fix documentation
Benjamin Otte [Fri, 17 Sep 2021 03:13:38 +0000 (03:13 +0000)]
Merge branch 'image-loading' into 'master'
Image loaders
See merge request GNOME/gtk!3939
Benjamin Otte [Fri, 17 Sep 2021 02:15:40 +0000 (04:15 +0200)]
gtk-demo: Use textures in listbox example
Benjamin Otte [Fri, 17 Sep 2021 02:10:56 +0000 (04:10 +0200)]
examples: Use textures over pixbufs
Benjamin Otte [Fri, 17 Sep 2021 02:07:59 +0000 (04:07 +0200)]
icontheme: Implement gtk_icon_theme_lookup_by_gicon() for textures
More feature parity.
Before this, it would have worked just as well - just going via a PNG
bytes step inbetween.
Benjamin Otte [Fri, 17 Sep 2021 02:05:40 +0000 (04:05 +0200)]
texture: Implement GIcon and GLoadableIcon
This is mainly for feature parity with GdkPixbuf. And it doesn't hurt
anyone (I hope).
Benjamin Otte [Fri, 17 Sep 2021 01:42:27 +0000 (03:42 +0200)]
texture: Refactor gdk_texture_new_from_bytes()
1. Split into a real loader and a fake one
2. Only try the fake one if the real one doesn't support the file.
Benjamin Otte [Fri, 17 Sep 2021 01:25:35 +0000 (03:25 +0200)]
texture: Rework error enum
1. Change INSUFFICIENT_MEMORY to TOO_LARGE
GTK crashes on insufficient memory, we don't emit GErrors.
2. Split UNSUPPORTED into UNSUPPORTED_CONTENT and UNSUPPORTED_FORMAT
So we know if you need to find an RPM with a loader or curse and
the weird file.
3. Translate error messages, they are meant for end users.
Benjamin Otte [Fri, 17 Sep 2021 00:34:15 +0000 (02:34 +0200)]
pixbufutils: Don't hardcode formats
Just let the loaders figure out the file format themselves.
Benjamin Otte [Fri, 17 Sep 2021 00:29:59 +0000 (02:29 +0200)]
icontheme: Insist that people provide proper values
Seriously...
Benjamin Otte [Tue, 14 Sep 2021 16:17:58 +0000 (18:17 +0200)]
icontheme: Use textures more
We were going via GLoadablieIcon/GInputStream for everything previously
and we have no API for that with GdkTexture.
With this commit, gdk-pixbuf isn't used anymore when starting
widget-factory for anything but SVG.
Benjamin Otte [Tue, 14 Sep 2021 15:49:40 +0000 (17:49 +0200)]
icontheme: Load textures directly when possible
This doesn't fix the codepaths for SVG (both for recoloring and
resizing) and doesn't handle streams yet.
Matthias Clasen [Wed, 15 Sep 2021 04:41:40 +0000 (00:41 -0400)]
Support 16bit formats in the png loader
When loading, convert all >8-bit data to
GDK_MEMORY_R16G16B16A16_PREMULTIPLIED.
When saving, save all 8-bit formats as 8-bit RGBA,
and save all >8-bt formats as 16-bit RGBA.
Matthias Clasen [Tue, 14 Sep 2021 21:46:11 +0000 (17:46 -0400)]
contentdeserializer: Use our on jpeg loader
Matthias Clasen [Tue, 14 Sep 2021 21:40:29 +0000 (17:40 -0400)]
Add code to save jpegs
Matthias Clasen [Tue, 14 Sep 2021 19:17:29 +0000 (15:17 -0400)]
builder: Stop using pixbufutils
We can just use gdk_pixbuf_new_from_resource here.
Matthias Clasen [Tue, 14 Sep 2021 19:12:39 +0000 (15:12 -0400)]
cssimageurl: Just create a texture directly
We don't need to use the pixbufutils api here.
Matthias Clasen [Tue, 14 Sep 2021 18:55:59 +0000 (14:55 -0400)]
builder: create textures without pixbufs
Load textures using the GdkTexture apis, without
going through a pixbuf first.
Benjamin Otte [Tue, 14 Sep 2021 15:40:09 +0000 (17:40 +0200)]
texture: Add private can_load() function
... and use it to load textures in gtk_picture_set_from_file().
Benjamin Otte [Tue, 14 Sep 2021 15:03:49 +0000 (17:03 +0200)]
texture: Split out type detection
This way, the code using it becomes clearer and we can use it in
multiple places without accidentally doing it wrong (hint: see next
commit).
Benjamin Otte [Tue, 14 Sep 2021 14:26:05 +0000 (16:26 +0200)]
texture: Remove declaration for nonexisting function
Matthias Clasen [Tue, 14 Sep 2021 12:52:35 +0000 (08:52 -0400)]
texture: Avoid pixbufs when loading resources
We can just use our own loaders here now.
Benjamin Otte [Tue, 14 Sep 2021 00:37:50 +0000 (02:37 +0200)]
testsuite: Add png and tiff methods
We encode the texture to a PNG or TIFF and then decode
it again, in various ways.
Benjamin Otte [Tue, 14 Sep 2021 00:36:56 +0000 (02:36 +0200)]
texture: Add gdk_texture_save_to_tiff_bytes()
Matthias Clasen [Mon, 13 Sep 2021 23:36:17 +0000 (19:36 -0400)]
rendernodeparser: Avoid gdk_texture_new_for_pixbuf
We can just use gdk_texture_new_from_bytes here now.
Update affected test output.
Matthias Clasen [Mon, 13 Sep 2021 18:59:20 +0000 (14:59 -0400)]
rendernodeparser: Use gdk_texture_save_to_png_bytes
Avoid cairo, and use our own api for saving png data.
Update affected test output.
Matthias Clasen [Sun, 12 Sep 2021 01:38:31 +0000 (21:38 -0400)]
Add contentserializer tests for textures
Matthias Clasen [Fri, 10 Sep 2021 02:23:37 +0000 (22:23 -0400)]
Use our own loaders for content (de)serialization
Use our own loader to (de)serialiaze textures
to and from png and tiff.
We still fall back to gdk-pixbuf for handling all
the other image formats, and for pixbufs.
Matthias Clasen [Sun, 12 Sep 2021 03:28:06 +0000 (23:28 -0400)]
Add tests for the jpeg loader
Matthias Clasen [Sat, 11 Sep 2021 21:02:41 +0000 (17:02 -0400)]
Load jpegs without gdk-pixbuf
Use our own loader for jpeg files.
Matthias Clasen [Tue, 14 Sep 2021 11:48:49 +0000 (07:48 -0400)]
Add code to load jpegs
This lets us avoid gdk-pixbuf for loading
textures from the common image formats.
As a consequence, we are now linking against libjpeg.
Matthias Clasen [Tue, 7 Sep 2021 13:20:05 +0000 (09:20 -0400)]
Add gdk_texture_save_to_tiff
This is a companion to gdk_texture_save_to_png, using
the tiff format, which will let us avoid lossy conversion
of HDR data, since we can store floating point data.
Matthias Clasen [Sun, 12 Sep 2021 05:07:16 +0000 (01:07 -0400)]
Add tests for the tiff loader
Matthias Clasen [Sat, 11 Sep 2021 20:30:37 +0000 (16:30 -0400)]
Load tiffs without gdk-pixbuf
This will let us load floating point data, in
the future.
Matthias Clasen [Fri, 10 Sep 2021 16:47:14 +0000 (12:47 -0400)]
Add code to load and save tiff files
Add support for the tiff format, which is flexible
enough to handle all our memory texture formats
without loss.
As a consequence, we are now linking against libtiff.
Matthias Clasen [Mon, 13 Sep 2021 18:29:31 +0000 (14:29 -0400)]
Add gdk_texture_save_to_png_bytes
Just expose what we already have available
internally, so e.g. tests can use it without
static linking.
Matthias Clasen [Sun, 12 Sep 2021 00:27:13 +0000 (20:27 -0400)]
Add tests for the png loader
Matthias Clasen [Sun, 12 Sep 2021 13:24:59 +0000 (09:24 -0400)]
Save pngs without cairo
Use our own loader for pngs, which will allow
us to save e.g. 16-bit data in the future.
Matthias Clasen [Sat, 11 Sep 2021 20:23:53 +0000 (16:23 -0400)]
Load pngs without gdk-pixbuf
Use our own loader for pngs, which will allow
us to get e.g. 16-bit data in the future.